<template>
  <div class="flex-box paddingR20 paddingB20" style="position: relative">
    <el-table :data="data.list" border style="width: 100%">
      <el-table-column prop="title" label="文件名称" />
      <el-table-column prop="creat_at" label="创建时间" />
      <el-table-column fixed="right" label="操作">
        <template #default="scope">
          <el-button type="primary" :disabled="scope.$index == 1" @click="download(scope.row.url)">
            查看
          </el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script lang="ts" setup>
import { ref, reactive, toRefs, onMounted } from 'vue'

const data = reactive({
  list: [
    {
      id: 1,
      title: '单一钱包接入文档',
      creat_at: '2024-03-25 15:42:00',
      url: 'https://www.showdoc.com.cn/2485927944770828/0'
    },
    { id: 2, title: '转账钱包接入文档', creat_at: '2024-03-25 15:43:00' }
  ]
})

const download = (url: string) => {
  console.log(url)
  window.open(url, '_blank')
}
</script>
<style scoped lang="scss"></style>
